<?php 
include 'header.php'; 
?>

<h1>Pages</h1>
		<span class="search">

</span>

<div id="alertfader"></div>
<div id="content">
<form name="pagesform" id="pagesform" action="<?php echo base_url(); ?>index.php/admin/pages/process" method="POST">
		<div id="buttons">
			
			<input type="submit" name="button" value="Delete" />
			<input type="submit" name="button" value="Make Invisible" />
			<input type="submit" name="button" value="Make Visible" />
			
			<span class="counts"><?php if (!empty($pagination)) {
					$lastnum = $offset + 10;
					$lastnum = min($lastnum, $numpages);
					if ($offset == 0) $offset = 1;
					echo '<span style="font-size: 10pt; margin-right: 20px">';
					echo "Displaying <b>" .$offset . "</b> to <b>" . $lastnum . "</b> out of <b>" . $numpages . "</b> pages";
					echo '</span>';
					echo $pagination;
					
			} ?></span>
			<br />&nbsp;<br /><span style="display: none;" id="selecting">Select: <span id="selall"><a href="#" onclick="return false" style="color: black">All</a></span>, <span id="selnone"><a href="#" onclick="return false" style="color: black">None</a></span>
			</span>

		</div>

<?php if (!empty($message)) { ?><div id="alert"><?php echo $message; ?></div><?php } ?>


<table cellspacing=0 ><tbody id="the-list">
	<?php if (!empty($pages)) { foreach ($pages as $page) { ?>
			<tr>	
		<td><input id="select_<?php echo $page->id; ?>" name="checkall[<?=$page->id?>]" value="<?php echo $page->id; ?>" type="checkbox" /></td>

		<td class="date <?php if ($page->invisible) { echo 'invisible'; } ?>"><?php echo $page->date; ?></td>
				<td class="pagetitle <?php if ($page->invisible) { echo 'invisible'; } ?>"><?php echo anchor("/admin/page/" . $page->id,$page->title); ?>  <?php if ($page->invisible) { echo '(Invisible)'; } ?></td>
				<td class="author <?php if ($page->invisible) { echo 'invisible'; } ?>" style="text-align: right; padding-right: 25px"></td>
				<td><a href="<?php echo base_url(); ?>index.php/page/<?php echo $page->id; ?>" title="View Page"><img src='<?php echo base_url(); ?>images/view.png' alt='view' /></a></td>
				<td><a href="<?php echo base_url(); ?>index.php/admin/page/<?php echo $page->id; ?>" title="Edit Page"><img src='<?php echo base_url(); ?>images/edit.png' alt='edit' /></a></td></td>
		<!--td><a href="<?php echo base_url(); ?>index.php/admin/page/delete/<?php echo $page->id; ?>" onclick="return false" title="Delete Page"><img src='<?php echo base_url(); ?>images/delete.png' alt='delete' /></a></td-->	
		</tr>
	<?php }} ?>
			

			
<input type='hidden' name='offset' id='offset' value=<?php echo $offset; ?> />
</tbody>
</table>
</form>
<?php
include 'footer.php';
?>